<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script src="https://cdn.bootcss.com/echarts/3.8.5/echarts.min.js"></script>

</head>
<body>
<div style="margin: 0 auto;text-align: center;"><h1>欢迎使用布布恰恰系统</h1>
    <div id="count" style="display: inline-block;width: 1100px;height:520px" align="center"></div>
    <script type="text/javascript">
        var chart = echarts.init(document.getElementById('count'));
        var yData = []
        Option = {
            baseOption: {
                noDataLoadingOption: {
                    text: '暂无数据',
                    effect: 'bubble',
                    effectOption: {
                        effect: {
                            n: 0
                        }
                    }
                },
                timeline: {
                    // y: 0,
                    axisType: 'category',
                    // realtime: false,
                    // loop: false,
                    autoPlay: true,
                    // currentIndex: 2,
                    playInterval: 10000,
                    // controlStyle: {
                    //     position: 'left'
                    // },
                    data: [],
                    label: {}
                },
                title: {
                    text: '七天各级分公司的销售总价',
                    left: 'center'
                },
                tooltip: {},
                legend: {
                    x: 'right',
                    data: [],

                },
                calculable: true,
                grid: {
                    top: 80,
                    bottom: 100,
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow',
                            label: {
                                show: true,
                                formatter: function (params) {
                                    return params.value.replace('\n', '');
                                }
                            }
                        }
                    }
                },
                toolbox: {
                    feature: {
                        dataView: {show: true, readOnly: false},
                        magicType: {show: true, type: ['line', 'bar']},
                        restore: {show: true},
                        saveAsImage: {show: true}
                    }
                },
                xAxis: [
                    {
                        'type': 'category',
                        'axisLabel': {'interval': 0},
                        'data': [],
                        'name': "各级分公司",
                        axisLabel: {
                            interval: 0,
                            rotate: 30
                        },
                        splitLine: {show: false}
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        name: '（销售总价）',
                        axisLabel: {
                            formatter: '{value} 元'
                        }
                    }
                ],
                series: [
                    {name: '销售总价', type: 'bar'},

                ]
            },
            options: []

        };
        chart.setOption(Option);
      /*  $.ajax({
            type: "post",
            async: true, //异步执行
            url: "/clothing/echarts/echartsMainInfo.do",
            dataType: "json", //返回数据形式为json
            success: function (data) {
                console.log(data.code)
                if (data.code == 0) {
                    yData = data.rows.countList
                    var options = []
                    for (var i = 0; i < yData.length; i++) {
                        options.push(
                            {
                                title: {
                                    text: data.rows.dateList[i] + '\t各机构的销售总额',
                                    left: 'center'
                                },
                                series: [
                                    {data: yData[i]},

                                ]
                            }
                        )
                    }
                    console.log(data.rows)
                    chart.hideLoading();
                    chart.setOption({
                        baseOption: {
                            timeline: {
                                data: data.rows.dateList
                            },
                            xAxis: {
                                data: data.rows.xnames
                            },
                        },
                        options: options
                    })
                    ;
                }
            },
            error: function (errorMsg) {
                $.messager.alert('提示!', '数据请求失败!', 'warning');
            }
        });*/

    </script>

</div>


</body>
</html>